<h1 class="page_title">Companies</h1>

<% if @companies.count > 0%>

<table>
  <tr>
    <th>Company name</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @companies.each do |company| %>
  <tr>
    <td><%= company.company_name %></td>
	<td><a href="/questionnaires?company_id=<%= company.id%>">Questionnaires</a></td>
	<td><%= link_to 'Show', company %></td>
    <td><%= link_to 'Edit', edit_company_path(company) %></td>
  </tr>
<% end %>
</table>

<br />

<% else %>
	<p>There are no companies</p>
<% end -%>

<% if logged_in? -%>
	<%= link_to 'New Company', new_company_path %>
<% end -%>

<style type="text/css">
	table{
		width: 100%;
	}
	th{
		border-bottom: solid 1px red;
		text-align: left;
	
	}
	a{
		color: blue;
	}
	tr{
			
	}
	td{
		padding : 5px;
	}
</style>
